import { fetchDashboardInfoAPI } from '@/api/dashboard/dashboardAPI'

const actions = {
  /*
  * 获取工作台信息的action
  *  */
  async fetchDashboardInfoAction(context) {
    const { data } = await fetchDashboardInfoAPI()
    context.commit('setDashboardInfoMutation', data)
    return data
  }
}
const mutations = {
  /*
  * 设置工作台信息的mutation
  *  */
  setDashboardInfoMutation(state, payload) {
    state.dashboardInfo = payload
  }
}
const state = () => {
  return {
    dashboardInfo: {}
  }
}

export default {
  actions,
  mutations,
  state,
  namespaced: true
}
